import request from '@/utils/request'

export function listMaterial(query) {  //查询素材分页
  return request({
    url: '/business/sourceMaterial/list',
    method: 'get',
    params: query
  })
}

export function myDel(imgId) {  //批量删除素材
  return request({
    url: '/business/sourceMaterial/' + imgId,
    method: 'delete'
  })
}

//成品库
export function chengpinList(query) {
  return request({
    url: '/business/article/finishedProductList',
    method: 'get',
    params: query
  })
}


//同步素材列表
export function sucaiSync(query) {
  return request({
    url: '/system/account/list',
    method: 'get',
    params: query
  })
}

//同步素材数量
export function sucaiSyncNum(openId,materialType) {
  return request({
    url: `/business/sourceMaterial/countSourceMaterialByType/${openId}/${materialType}`,
    method: 'get',
    // params: query
  })
}

//获取微信授权页面链接
export function getScanCodeAuthUrl(userId) {  //查询素材分页
  return request({
    url: '/openplatform/getScanCodeAuthUrl/',
    method: 'get',
    //params: query
  })
}

//新增认证资料
export function authenticationDataUser(data) {
  return request({
    url: '/business/authenticationDataUser',
    method: 'post',
    data: data
  })
}


//新增认证资料
export function UpdateDataUser(data) {
  return request({
    url: '/business/authenticationDataUser',
    method: 'put',
    data: data
  })
}



//获得授权列表
export function systemAuthLists(data) {
  return request({
    url: '/system/account/list',
    method: 'get',
    params: data
  })
}


//根据用户ID获取认证资料详细信息
export function getInfoByUserId(userId) {
  return request({
    url: `/business/authenticationDataUser/getInfoByUserId/${userId}`,
    method: 'get',
    //params: data
  })
}

//查询待审核分页 examineType 审核类型： 0：版权审核，1：一审，2：二审
export function contentExamine(data) {
  return request({
    url: `/business/contentExamine/list`,
    method: 'get',
    params: data
  })
}

//

///business/contentExamine/contentReviewCopyright

//新增认证资料(添加修改同接口操作)
// export function authenticationDataUser(data) {
//   return request({
//     url: '/business/authenticationDataUser',
//     method: 'post',
//     data: data
//   })
// }



//添加素材
export function addMySources(data) {
  return request({
    url: '/business/sourceMaterial',
    method: 'post',
    data: data
  })
}


//上传公共文件
export function postCommonFile(data) {
  return request({
    url: '/common/resourceFileUpload',
    method: 'post',
    data: {'folderType':data}  //上传的文件类型1：图片，2：视频，3：音频，4：动漫，5：挂图 6：版权文件 7、认证资料
  })
}
//同步素材
export function syncMaterial(data) {
  return request({
    url: '/business/sourceMaterial/syncMaterial',
    method: 'put',
    data: data
  })
}

//获得openID
export function myOpenId(data) {
  return request({
    url: '/system/account/list',
    method: 'get',
    params: data
  })
}

//修改回显
export function showSucaiEdit(materialId) {
  return request({
    url: '/business/sourceMaterial/' + materialId,
    method: 'get',
   // params: data
  })
}



//初稿库
export function chugaoList(query) {
  return request({
    url: '/business/article/draftList',
    method: 'get',
    params: query
  })
}
//审核管理
export function shenheList(query) {
  return request({
    url: '/business/contentExamine/list',
    method: 'get',
    params: query
  })
}
//账号管理
export function yunzhang(query) {
  return request({
    url: '/business/authenticationDataUser/getCheckAuthenticationPage',
    method: 'get',
    params: query
  })
}
//账号管理详情

export function yunzhangdetail(materialId) {
  return request({
    url: '/business/authenticationDataUser/getInfoByUserDataId/' + materialId,
    method: 'get',
   // params: data
  })
}
//提交账号申请
export function tijiaozhang(data) {
  return request({
      url: '/business/authenticationDataUser/checkAuthenticationData',
      method: 'put',
      data: data
  })
}
//渠道管理
export function qudao(query) {
  return request({
    url: '/system/platform/list',
    method: 'get',
    params: query
  })
}
//渠道详情
export function qudaodetail(materialId) {
  return request({
    url: '/system/platform/getPlatformInfo/' + materialId,
    method: 'get',
   // params: data
  })
}

//添加渠道
export function addqudao(data) {
  return request({
    url: '/system/platform',
    method: 'post',
    data: data
  })
}
//批量删除渠道
export function delqudao(imgId) {  
  return request({
    url: '/system/platform/batchDelPlatform/' + imgId,
    method: 'delete'
  })
}
//修改渠道
export function editqudao(data) {
  return request({
      url: '/system/platform',
      method: 'put',
      data: data
  })
}
//获取全部审人员
export function getAuditStaff(data) {
  return request({
      url: '/business/authenticationDataUser/getAuditStaff',
      method: 'get',
      params: data
  })
}

//提交文章审核
export function submitArticleAudit(data) {
  return request({
    url: '/business/contentExamine/submitArticleAudit',
    method: 'post',
    data: data
  })
}

//生成文章二维码
export function generateArticleQR(url) {
  return request({
    url: '/business/article/generateArticleQR',
    method: 'post',
    data: url
  })
}

//根据医院名称模糊检索
export function getHospitalInfo(data) {
  return request({
    url: '/business/authenticationDataUser/getHospitalInfo',
    method: 'get',
    params: data
  })
}

//批量添加文章发布
export function report(data) {
  return request({
    url: '/business/report',
    method: 'post',
    data: data
  })
}

//预览接口
export function ArticlePreview(data) {
  return request({
      url: '/business/article/ArticlePreview',
      method: 'get',
      params: data
  })
}

//运营版权审核表单提交
export function contentReviewCopyright(data) {
  return request({
    url: '/business/contentExamine/contentReviewCopyright',
    method: 'post',
    data: data
  })
}

//二审
export function contentReviewTwo(data) {
  return request({
    url: '/business/contentExamine/contentReviewTwo',
    method: 'post',
    data: data
  })
}



//新增渠道
// 查询用户列表
// export function listUser(query) {
//   return request({
//     url: '/system/user/list',
//     method: 'get',
//     params: query
//   })
// }

// 查询用户详细
// export function getUser(userId) {
//   return request({
//     url: '/system/user/' + parseStrEmpty(userId),
//     method: 'get'
//   })
// }

// 新增用户
// export function addUser(data) {
//   return request({
//     url: '/system/user',
//     method: 'post',
//     data: data
//   })
// }
